#![allow(non_camel_case_types)]
#![allow(dead_code)]
#![allow(non_snake_case)]

use crate::*;

// import lang from './@arkts.lang';
use crate::arkts::lang::default as lang;

pub mod collections {
	use super::*;

	pub type TypedArrayFromMapFn<'val, FromElementType, ToElementType> = dyn Fn(FromElementType, number<'val>) -> ToElementType;
	pub type TypedArrayPredicateFn<'val, ElementType, ArrayType> = dyn Fn(ElementType, number<'val>, ArrayType) -> boolean;
	pub type TypedArrayForEachCallback<'val, ElementType, ArrayType> = dyn Fn(ElementType, number<'val>, ArrayType) -> ();
	pub type TypedArrayMapCallback<'val, ElementType, ArrayType> = dyn Fn(ElementType, number<'val>, ArrayType) -> ElementType;
	pub type TypedArrayReduceCallback<'val, AccType, ElementType, ArrayType> = dyn Fn(AccType, ElementType, number<'val>, ArrayType) -> AccType;
	pub type TypedArrayCompareFn<'val, ElementType> = dyn Fn(ElementType, ElementType) -> number<'val>;
	pub type ArrayFromMapFn<'val, FromElementType, ToElementType> = dyn Fn(FromElementType, number<'val>) -> ToElementType;
	pub type ArrayPredicateFn<'val, ElementType, ArrayType> = dyn Fn(ElementType, number<'val>, ArrayType) -> boolean;
	pub type ArrayForEachCallback<'val, ElementType, ArrayType> = dyn Fn(ElementType, number<'val>, ArrayType) -> ();

	// type ISendable = lang.ISendable;
	pub use lang::ISendable;

	// // interface ConcatArray<T> extends ISendable {
	pub trait ConcatArray<'val, T>: ISendable<'val> {}

	// class Array<T> implements ConcatArray<T> {
	pub struct Array<'val, T>(pub Value<'val>, core::marker::PhantomData<T>);
	IMPL_NAPI!(Array<T>, Value);
	impl<'val, T> ConcatArray<'val, T> for Array<'val, T> {}
	impl<'val, T> ISendable<'val> for Array<'val, T> {}
	impl<'val, T> InterFace<'val> for Array<'val, T> {
		fn v(&self) -> Value<'val> {
			self.0
		}
	}

	// class Map<K, V> {
	pub struct Map<'val, K, V>(pub Value<'val>, core::marker::PhantomData<K>, core::marker::PhantomData<V>);
	IMPL_NAPI!(Map<K, V>, Value);

	// class Set<T> {
	pub struct Set<'val, T>(pub Value<'val>, core::marker::PhantomData<T>);
	IMPL_NAPI!(Set<T>, Value);

	// class ArrayBuffer {
	pub struct ArrayBuffer<'val>(pub Value<'val>);
	IMPL_NAPI!(ArrayBuffer, Value);

	// class Int8Array {
	pub struct Int8Array<'val>(pub Value<'val>);
	IMPL_NAPI!(Int8Array, Value);

	// class Uint8ClampedArray {
	pub struct Uint8ClampedArray<'val>(pub Value<'val>);
	IMPL_NAPI!(Uint8ClampedArray, Value);

	// class Uint8Array {
	pub struct Uint8Array<'val>(pub Value<'val>);
	IMPL_NAPI!(Uint8Array, Value);

	// class Int16Array {
	pub struct Int16Array<'val>(pub Value<'val>);
	IMPL_NAPI!(Int16Array, Value);

	// class Uint16Array {
	pub struct Uint16Array<'val>(pub Value<'val>);
	IMPL_NAPI!(Uint16Array, Value);

	// class Int32Array {
	pub struct Int32Array<'val>(pub Value<'val>);
	IMPL_NAPI!(Int32Array, Value);

	// class Uint32Array {
	pub struct Uint32Array<'val>(pub Value<'val>);
	IMPL_NAPI!(Uint32Array, Value);

	// class Float32Array {
	pub struct Float32Array<'val>(pub Value<'val>);
	IMPL_NAPI!(Float32Array, Value);

	// class BitVector {
	pub struct BitVector<'val>(pub Value<'val>);
	IMPL_NAPI!(BitVector, Value);
}
pub use collections as default;
